from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    def jianzhi(self):  #ANDROID_UIAUTOMATOR
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("androidx.appcompat.app.ActionBar$Tab").instance(2)')
        ele=self.find_loc(loc)
        return ele
    def zao(self):  #XPATH
        loc=(By.XPATH,'//android.widget.HorizontalScrollView[@resource-id="com.xiachufang:id/tab_plan_rec"]/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[1]')
        ele=self.find_loc(loc)
        return ele
    def xinyonghu(self):  #ID
        loc=(By.ID,'com.xiachufang:id/tv_join')
        ele=self.find_loc(loc)
        return ele
    def gouxuan(self):  #CLASS_NAME
        loc=(By.CLASS_NAME,'android.widget.CheckBox')
        ele=self.find_loc(loc)
        return ele
    def fanhui(self):  #accessibility id
        loc=(By.ACCESSIBILITY_ID,'返回')
        ele=self.find_loc(loc)
        return ele
    def duanyan1(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="午餐"]')
        ele=self.find_loc(loc)
        return ele
    def duanyan2(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="晚餐"]')
        ele=self.find_loc(loc)
        return ele